package com.hhs.storage.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.hhs.storage.bean.Result;
import com.hhs.storage.bean.YymUserYijian;
import com.hhs.storage.service.YymUserExtService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.ResultMap;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yuanjun
 * @since 2020-08-14
 */
@RestController
@RequestMapping("/do/yymuserext")
@Slf4j
public class YymUserExtController {
    @Resource
    YymUserExtService yymUserExtService;
    @RequestMapping(value = "getUserExt")
    public Map<String, Object> getAll(String userid) throws Exception {
        log.info("查询意见分页信息");
        EntityWrapper ew = new EntityWrapper<YymUserYijian>();
        ew.eq("user_id_",userid);
        List usere = yymUserExtService.selectList(ew);
        if(usere.size()>0){
            return Result.sucJsonResp(usere.get(0));
        }
        return Result.failJsonResp(null);
    }
}

